#ifndef _PRESENTATION_HPP_
#define _PRESENTATION_HPP_

#include "include.hpp"
#include "paramhandler.hpp"

class xlider_presentation:public xlider_class {
	friend void start_element(void* udata, const char *tag, const char **attr);
	friend void end_element(void *userData, const char *tag);
	friend void text_content(void *pclass, const char* content, int len);
	friend void start_cdata(void* pclass);
	friend void end_cdata(void* pclass);

public:
	
	string filename;
	bool compile_this_slide;

	int slide_idx;
	
	xml_config_reader theme;
	param_handler param;
	string inter_script;
	string slide_script;
	string slide_to_compile;
	vector<string> slide_names;
	vector<string> attr_name;
	vector<string> attr_value;
	vector<class item_data*> item;
	stack<string>  stag;
	stack<int> item_index_stack;

	// parser----
	bool parsing_start;
	XML_Parser parser;
	bool c_data;
	int current_item;

	xlider_presentation(string pf);
	virtual ~xlider_presentation(){}
	void translate_param(const char *tag, const char **attr);
	void get_presentation_param();
	xml_config_reader* get_themeptr(){return &theme;}
	
	void prepare_slide();
	void fetch_slide(char* cstr);

	virtual void create_slide()=0;
	virtual void combine_slides()=0;
	virtual void assign_generators()=0;
	
	void prepare_item();
	void prepare_inline();
	void prepare_figure();
	void prepare_movie();

	void create_item();
	void fetch_item(char* cstr);

	void compile(string slide="");
	void error_handler();
	void read_theme();
	void read_theme_overide();
	
	void start(const char *tag, const char **attr);
	void fetch(const char* content, int len);
	void end(const char *tag);

};

#endif
